/**
 * Created by lx on 17/6/5.
 */
'use strict';
(function(win) {
    var baseUrl = document.getElementById('main').getAttribute('data-baseurl');
    var config = {
        baseUrl: baseUrl,
        paths: {
            zepto: 'js/libs/zepto.min',
            underscore: 'js/libs/underscore',
            text: 'js/libs/text',
            director: 'js/libs/director',
        },
        shim: {
            underscore: {exports: '_'},
            zepto: {exports: '$'},
            director: {exports: 'Router'}
        }
    };

    require.config(config);


    require(['js/router', 'zepto'], function(R, $) {
        win.appView = $('#container');      //用于各个模块控制视图变化
        win.$ = $;                          //暴露必要的全局变量，没必要拘泥于requirejs的强制模块化
        win._ = _;
        if (!/#/.test(location.href)) location.href = location.href + '#home';
        R.init();
    });

})(window);